home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / ultqsrc.zip / FLAME.QC < prev    next >
Text File  |  1996-10-04  |  2KB  |  83 lines

  1. /*
  2. ================
  3. FlameTouch
  4. ================
  5. */
  6. void () FlameTouch =
  7. {
  8.         local   float   rn;
  9.  
  10.         if (other.takedamage)
  11.         {
  12.                 rn = random();
  13.                 // 50% chance
  14.                 if (rn <= 0.5)
  15.                         {
  16.                         if(other.onfire)
  17.                                 other.onfire = other.onfire + 1;
  18.                         remove(self);
  19.                         }
  20.                 other.onfire = other.onfire + 1;
  21.                 self.wait = 160;
  22.                 self.enemy = other;
  23.                 self.active = 0.25;
  24.                 self.think = FireDamage;
  25.                 self.nextthink = time;
  26.                 self.solid = SOLID_NOT;
  27.                 setmodel (self,"");
  28.         }
  29.         else if (other.classname == "worldspawn")
  30.         {
  31.                 self.velocity = '0 0 0';
  32.         }
  33. };
  34.  
  35. /*
  36. ================
  37. W_FireFlame
  38. ================
  39. */
  40. void() W_FireFlame =
  41. {
  42.         local   entity flame;
  43.         local   float rn;
  44.  
  45.         if (self.waterlevel > 2)
  46.         {
  47. //                makevectors (self.v_angle);
  48.  
  49.                 rn = random();
  50.                 if (rn < 0.5)
  51.                         sound (self, CHAN_WEAPON, "misc/water1.wav", 1, ATTN_NORM);
  52.                 else
  53.                         sound (self, CHAN_WEAPON, "misc/water2.wav", 1, ATTN_NORM);
  54.                 return;
  55.         }
  56.  
  57.         // Take away a shell
  58.         self.currentammo = self.ammo_shells = self.ammo_shells - 1;
  59.  
  60.         sound (self, CHAN_WEAPON, "hknight/hit.wav", 1, ATTN_NORM);
  61.  
  62.         flame = spawn ();
  63.         flame.owner = self;
  64.         flame.movetype = MOVETYPE_FLYMISSILE;
  65.         flame.solid = SOLID_BBOX;
  66.         flame.classname = "fire";
  67.         
  68. // set flame speed    
  69.  
  70.     makevectors (self.v_angle);
  71.  
  72.         flame.velocity = (aim(self, 10000)* 400)+'0 0 32' + v_right * (random()*16 - 8);
  73.         flame.effects = 8;
  74.         flame.touch = FlameTouch;
  75.     
  76.         flame.think = SUB_Remove;
  77.         flame.nextthink = time + 1.5;
  78.  
  79.         setmodel (flame, "progs/flame2.mdl");
  80.         setsize (flame, '0 0 0', '0 0 0');            
  81.         setorigin (flame, self.origin + v_forward * 32 + v_up * (random()*16 - 8) + '0 0 16');
  82. };
  83.